﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SYcwpb.Helpers;

namespace SYcwpb.WinForm
{
    public partial class InputDraftNameForm : Form
    {
        public static string DraftName = null;
        public InputDraftNameForm()
        {
            InitializeComponent();
        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(textBox1.Text))
                {
                    MessageBoxHelper.ShowError("草稿名不能为空");
                    return;
                }
                DraftName = textBox1.Text;
                this.DialogResult = DialogResult.Yes;
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBoxHelper.ShowError(ex);
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            try
            {

                this.DialogResult = DialogResult.No;
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBoxHelper.ShowError(ex);
            }
        }
    }
}
